﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace Etapa1.ComercioEspacial
{
    public partial class CompraVenda : Form
    {

        String productName; 
        float maxQuantity; 
        bool venda;
        float preco;

        public CompraVenda(String productName, float preco, float maxQuantity, bool venda)
        {
            this.venda = venda;
            this.preco = preco;
            this.maxQuantity = maxQuantity;
            this.productName = productName;

            InitializeComponent();
        }

        private void CompraVenda_Load(object sender, EventArgs e)
        {
            if (venda)
            {
                label1.Text = "Vender ";
            }
            else
            {
                label1.Text = "Comprar ";
            }
            label1.Text += productName;
            label2.Text = "Preco " + preco;
            numericUpDown1.Maximum = Convert.ToDecimal(maxQuantity);
        }

        private void button1_Click(object sender, EventArgs e)
        {
            Quantidade = Convert.ToInt32(numericUpDown1.Value);
            this.Close();
        }

        public int Quantidade = 0;
    }
}
